Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

SQR(s(X)) → S(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
ACTIVATE(n__dbl(X)) → DBL(activate(X))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
TERMS(N) → SQR(N)
ACTIVATE(n__add(X1, X2)) → ADD(activate(X1), activate(X2))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
SQR(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__s(X)) → S(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → S(n__s(n__dbl(activate(X))))
DBL(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__sqr(X)) → SQR(activate(X))
ADD(s(X), Y) → S(n__add(activate(X), Y))
ADD(s(X), Y) → ACTIVATE(X)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

SQR(s(X)) → S(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
ACTIVATE(n__dbl(X)) → DBL(activate(X))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
TERMS(N) → SQR(N)
ACTIVATE(n__add(X1, X2)) → ADD(activate(X1), activate(X2))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
SQR(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__s(X)) → S(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → S(n__s(n__dbl(activate(X))))
DBL(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__sqr(X)) → SQR(activate(X))
ADD(s(X), Y) → S(n__add(activate(X), Y))
ADD(s(X), Y) → ACTIVATE(X)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 4 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
QDP
          ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__dbl(X)) → DBL(activate(X))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
TERMS(N) → SQR(N)
ACTIVATE(n__add(X1, X2)) → ADD(activate(X1), activate(X2))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__sqr(X)) → SQR(activate(X))
ADD(s(X), Y) → ACTIVATE(X)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__add(X1, X2)) → ADD(activate(X1), activate(X2)) at position [0] we obtained the following new rules:

ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
QDP
              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → DBL(activate(X))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__sqr(X)) → SQR(activate(X))

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__sqr(X)) → SQR(activate(X)) at position [0] we obtained the following new rules:

ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
QDP
                  ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(X)) → DBL(activate(X))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__dbl(X)) → DBL(activate(X)) at position [0] we obtained the following new rules:

ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
QDP
                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
TERMS(N) → SQR(N)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2))
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(X1, X2)) → FIRST(activate(X1), activate(X2)) at position [0] we obtained the following new rules:

ACTIVATE(n__first(n__dbl(x0), y1)) → FIRST(dbl(activate(x0)), activate(y1))
ACTIVATE(n__first(n__terms(x0), y1)) → FIRST(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__first(x0, x1), y1)) → FIRST(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
QDP
                          ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(x0), y1)) → FIRST(dbl(activate(x0)), activate(y1))
TERMS(N) → SQR(N)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1))
SQR(s(X)) → ACTIVATE(X)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__terms(x0), y1)) → FIRST(terms(activate(x0)), activate(y1))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__first(x0, x1), y1)) → FIRST(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__dbl(x0), y1)) → FIRST(dbl(activate(x0)), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
QDP
                              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(x0), y1)) → FIRST(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__first(x0, x1), y1)) → FIRST(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__terms(x0), y1)) → FIRST(terms(activate(x0)), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
QDP
                                  ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1))
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__first(x0, x1), y1)) → FIRST(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__first(x0, x1), y1)) → FIRST(first(activate(x0), activate(x1)), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
QDP
                                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__sqr(x0), y1)) → FIRST(sqr(activate(x0)), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
QDP
                                          ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__add(x0, x1), y1)) → FIRST(add(activate(x0), activate(x1)), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
QDP
                                              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__s(x0), y1)) → FIRST(s(x0), activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
QDP
                                                  ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(x0, y1)) → FIRST(x0, activate(y1)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
QDP
                                                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
QDP
                                                          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__s(x0))) → FIRST(dbl(activate(y0)), n__s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
QDP
                                                              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
QDP
                                                                  ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__first(n__terms(y0), n__s(x0))) → FIRST(terms(activate(y0)), n__s(x0))
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
QDP
                                                                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
QDP
                                                                          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__first(y0, y1), n__s(x0))) → FIRST(first(activate(y0), activate(y1)), n__s(x0))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
QDP
                                                                              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
QDP
                                                                                  ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__first(n__sqr(y0), n__s(x0))) → FIRST(sqr(activate(y0)), n__s(x0))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
QDP
                                                                                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
QDP
                                                                                          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__first(n__add(y0, y1), n__s(x0))) → FIRST(add(activate(y0), activate(y1)), n__s(x0))
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
                                                                                        ↳ QDP
                                                                                          ↳ DependencyGraphProof
QDP
                                                                                              ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
                                                                                        ↳ QDP
                                                                                          ↳ DependencyGraphProof
                                                                                            ↳ QDP
                                                                                              ↳ Narrowing
QDP
                                                                                                  ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__s(x0))) → FIRST(s(y0), n__s(x0))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
                                                                                        ↳ QDP
                                                                                          ↳ DependencyGraphProof
                                                                                            ↳ QDP
                                                                                              ↳ Narrowing
                                                                                                ↳ QDP
                                                                                                  ↳ DependencyGraphProof
QDP
                                                                                                      ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, s(x0)) at position [1] we obtained the following new rules:

ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, n__s(x0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
                                                                                        ↳ QDP
                                                                                          ↳ DependencyGraphProof
                                                                                            ↳ QDP
                                                                                              ↳ Narrowing
                                                                                                ↳ QDP
                                                                                                  ↳ DependencyGraphProof
                                                                                                    ↳ QDP
                                                                                                      ↳ Narrowing
QDP
                                                                                                          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(y0, n__s(x0))) → FIRST(y0, n__s(x0))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ QDP
          ↳ Narrowing
            ↳ QDP
              ↳ Narrowing
                ↳ QDP
                  ↳ Narrowing
                    ↳ QDP
                      ↳ Narrowing
                        ↳ QDP
                          ↳ Narrowing
                            ↳ QDP
                              ↳ Narrowing
                                ↳ QDP
                                  ↳ Narrowing
                                    ↳ QDP
                                      ↳ Narrowing
                                        ↳ QDP
                                          ↳ Narrowing
                                            ↳ QDP
                                              ↳ Narrowing
                                                ↳ QDP
                                                  ↳ Narrowing
                                                    ↳ QDP
                                                      ↳ Narrowing
                                                        ↳ QDP
                                                          ↳ DependencyGraphProof
                                                            ↳ QDP
                                                              ↳ Narrowing
                                                                ↳ QDP
                                                                  ↳ DependencyGraphProof
                                                                    ↳ QDP
                                                                      ↳ Narrowing
                                                                        ↳ QDP
                                                                          ↳ DependencyGraphProof
                                                                            ↳ QDP
                                                                              ↳ Narrowing
                                                                                ↳ QDP
                                                                                  ↳ DependencyGraphProof
                                                                                    ↳ QDP
                                                                                      ↳ Narrowing
                                                                                        ↳ QDP
                                                                                          ↳ DependencyGraphProof
                                                                                            ↳ QDP
                                                                                              ↳ Narrowing
                                                                                                ↳ QDP
                                                                                                  ↳ DependencyGraphProof
                                                                                                    ↳ QDP
                                                                                                      ↳ Narrowing
                                                                                                        ↳ QDP
                                                                                                          ↳ DependencyGraphProof
QDP

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__first(n__sqr(y0), n__sqr(x0))) → FIRST(sqr(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__sqr(n__first(x0, x1))) → SQR(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), x0)) → FIRST(s(y0), x0)
ACTIVATE(n__first(y0, x0)) → FIRST(y0, x0)
ACTIVATE(n__dbl(n__dbl(x0))) → DBL(dbl(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__first(x0, x1))) → FIRST(terms(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__terms(x0))) → FIRST(first(activate(y0), activate(y1)), terms(activate(x0)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(X)
ACTIVATE(n__dbl(X)) → ACTIVATE(X)
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__sqr(n__dbl(x0))) → SQR(dbl(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), n__first(x0, x1))) → FIRST(first(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__dbl(x0))) → FIRST(first(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__first(x0, x1))) → FIRST(dbl(activate(y0)), first(activate(x0), activate(x1)))
ADD(s(X), Y) → ACTIVATE(X)
ACTIVATE(n__first(n__s(y0), n__terms(x0))) → FIRST(s(y0), terms(activate(x0)))
ACTIVATE(n__sqr(n__add(x0, x1))) → SQR(add(activate(x0), activate(x1)))
ACTIVATE(n__first(y0, n__first(x0, x1))) → FIRST(y0, first(activate(x0), activate(x1)))
ACTIVATE(n__dbl(x0)) → DBL(x0)
ACTIVATE(n__add(n__terms(x0), y1)) → ADD(terms(activate(x0)), activate(y1))
ACTIVATE(n__first(y0, n__dbl(x0))) → FIRST(y0, dbl(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__first(x0, x1))) → FIRST(add(activate(y0), activate(y1)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__add(x0, x1))) → FIRST(first(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__add(x0, x1))) → DBL(add(activate(x0), activate(x1)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__first(n__dbl(y0), n__terms(x0))) → FIRST(dbl(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__dbl(x0))) → FIRST(terms(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(X1, X2)) → ACTIVATE(X2)
DBL(s(X)) → ACTIVATE(X)
ACTIVATE(n__sqr(n__s(x0))) → SQR(s(x0))
ACTIVATE(n__first(y0, n__sqr(x0))) → FIRST(y0, sqr(activate(x0)))
ACTIVATE(n__sqr(x0)) → SQR(x0)
ACTIVATE(n__sqr(n__terms(x0))) → SQR(terms(activate(x0)))
ACTIVATE(n__add(n__sqr(x0), y1)) → ADD(sqr(activate(x0)), activate(y1))
ACTIVATE(n__add(x0, y1)) → ADD(x0, activate(y1))
ACTIVATE(n__first(n__dbl(y0), x0)) → FIRST(dbl(activate(y0)), x0)
ACTIVATE(n__first(n__dbl(y0), n__dbl(x0))) → FIRST(dbl(activate(y0)), dbl(activate(x0)))
TERMS(N) → SQR(N)
ACTIVATE(n__add(n__s(x0), y1)) → ADD(s(x0), activate(y1))
SQR(s(X)) → ACTIVATE(X)
ACTIVATE(n__first(y0, n__add(x0, x1))) → FIRST(y0, add(activate(x0), activate(x1)))
ACTIVATE(n__dbl(n__first(x0, x1))) → DBL(first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__sqr(x0))) → FIRST(add(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__add(x0, x1))) → FIRST(sqr(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__terms(X)) → TERMS(activate(X))
ACTIVATE(n__dbl(n__s(x0))) → DBL(s(x0))
ACTIVATE(n__first(n__s(y0), n__sqr(x0))) → FIRST(s(y0), sqr(activate(x0)))
ACTIVATE(n__terms(X)) → ACTIVATE(X)
ACTIVATE(n__first(n__add(y0, y1), n__add(x0, x1))) → FIRST(add(activate(y0), activate(y1)), add(activate(x0), activate(x1)))
ACTIVATE(n__add(n__dbl(x0), y1)) → ADD(dbl(activate(x0)), activate(y1))
ACTIVATE(n__dbl(n__sqr(x0))) → DBL(sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), x0)) → FIRST(add(activate(y0), activate(y1)), x0)
ACTIVATE(n__first(n__sqr(y0), n__terms(x0))) → FIRST(sqr(activate(y0)), terms(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__sqr(x0))) → FIRST(terms(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__s(y0), n__add(x0, x1))) → FIRST(s(y0), add(activate(x0), activate(x1)))
ACTIVATE(n__sqr(X)) → ACTIVATE(X)
ACTIVATE(n__add(n__add(x0, x1), y1)) → ADD(add(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__sqr(n__sqr(x0))) → SQR(sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__terms(x0))) → FIRST(terms(activate(y0)), terms(activate(x0)))
ACTIVATE(n__add(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__add(n__first(x0, x1), y1)) → ADD(first(activate(x0), activate(x1)), activate(y1))
ACTIVATE(n__first(n__terms(y0), x0)) → FIRST(terms(activate(y0)), x0)
ACTIVATE(n__first(n__sqr(y0), n__dbl(x0))) → FIRST(sqr(activate(y0)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__sqr(x0))) → FIRST(dbl(activate(y0)), sqr(activate(x0)))
ACTIVATE(n__first(n__add(y0, y1), n__dbl(x0))) → FIRST(add(activate(y0), activate(y1)), dbl(activate(x0)))
ACTIVATE(n__first(n__dbl(y0), n__add(x0, x1))) → FIRST(dbl(activate(y0)), add(activate(x0), activate(x1)))
ACTIVATE(n__first(n__add(y0, y1), n__terms(x0))) → FIRST(add(activate(y0), activate(y1)), terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), n__first(x0, x1))) → FIRST(sqr(activate(y0)), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__first(y0, y1), n__sqr(x0))) → FIRST(first(activate(y0), activate(y1)), sqr(activate(x0)))
ACTIVATE(n__first(n__terms(y0), n__add(x0, x1))) → FIRST(terms(activate(y0)), add(activate(x0), activate(x1)))
FIRST(s(X), cons(Y, Z)) → ACTIVATE(Z)
ACTIVATE(n__first(y0, n__terms(x0))) → FIRST(y0, terms(activate(x0)))
ACTIVATE(n__first(n__sqr(y0), x0)) → FIRST(sqr(activate(y0)), x0)
ACTIVATE(n__first(n__s(y0), n__first(x0, x1))) → FIRST(s(y0), first(activate(x0), activate(x1)))
ACTIVATE(n__first(n__s(y0), n__dbl(x0))) → FIRST(s(y0), dbl(activate(x0)))
ACTIVATE(n__dbl(n__terms(x0))) → DBL(terms(activate(x0)))
ACTIVATE(n__first(n__first(y0, y1), x0)) → FIRST(first(activate(y0), activate(y1)), x0)

The TRS R consists of the following rules:

terms(N) → cons(recip(sqr(N)), n__terms(n__s(N)))
sqr(0) → 0
sqr(s(X)) → s(n__add(n__sqr(activate(X)), n__dbl(activate(X))))
dbl(0) → 0
dbl(s(X)) → s(n__s(n__dbl(activate(X))))
add(0, X) → X
add(s(X), Y) → s(n__add(activate(X), Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(activate(X), activate(Z)))
terms(X) → n__terms(X)
s(X) → n__s(X)
add(X1, X2) → n__add(X1, X2)
sqr(X) → n__sqr(X)
dbl(X) → n__dbl(X)
first(X1, X2) → n__first(X1, X2)
activate(n__terms(X)) → terms(activate(X))
activate(n__s(X)) → s(X)
activate(n__add(X1, X2)) → add(activate(X1), activate(X2))
activate(n__sqr(X)) → sqr(activate(X))
activate(n__dbl(X)) → dbl(activate(X))
activate(n__first(X1, X2)) → first(activate(X1), activate(X2))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.